
package nc.impl.cmp.cmpconfimpayment.cmpconfimpayment;

import nc.bs.pfxx.plugin.AbstractPfxxPlugin;
import nc.vo.pub.BusinessException;
import nc.bs.pfxx.ISwapContext;
import nc.vo.pfxx.auxiliary.AggxsysregisterVO;
import nc.vo.pfxx.util.PfxxPluginUtils;
import nc.bs.framework.common.NCLocator;
import nc.vo.cmp.cmpconfimpayment.CmpConfimPaymentVO;
import nc.itf.cmp.cmpconfimpayment.cmpconfimpayment.ICmpConfimPaymentVOService;

public class CmpConfimPaymentVOPfxxPlugin extends AbstractPfxxPlugin {
	
	@Override
	protected Object processBill(Object vo, ISwapContext swapContext, AggxsysregisterVO aggxsysvo)
			throws BusinessException {
		CmpConfimPaymentVO entityVO = (CmpConfimPaymentVO)vo;
		String vopk = PfxxPluginUtils.queryBillPKBeforeSaveOrUpdate(swapContext.getBilltype(), swapContext.getDocID());
		entityVO.setPrimaryKey(vopk);
		CmpConfimPaymentVO[] saveVO = getService().saveCmpConfimPaymentVO(entityVO);
		return saveVO;
	}
	
	private ICmpConfimPaymentVOService getService() {
		return NCLocator.getInstance().lookup(ICmpConfimPaymentVOService.class);
	}
}